/**
 * @brief sizeof_args<Args...> : 求 args 所占用内存控件
 *
 */
#if _MSVC_LANG >= 201903
// 逗号表达式实现，c++17 以上支持
template <typename... Args>
static const size_t sizeof_args = (sizeof(Args) + ...);
#else
// C++ 17以下 解决办法

template <typename... Args>
static const size_t sizeof_args = SizeOfArgsPrivate::sizeof_args_impl<Args...>::value;

namespace SizeOfArgsPrivate {
// 前置声明
template <typename... Args>
struct sizeof_args_impl;

// 递归开始
template <typename First, typename... Rest>
struct sizeof_args_impl<First, Rest...> {
    static const size_t value = sizeof(First) + sizeof_args_impl<Rest...>::value;
};

// 递归结束
template <typename Last>
struct sizeof_args_impl<Last> {
    static const size_t value = sizeof(Last);
};
} // namespace SizeOfArgsPrivate
#endif